﻿Public Class xtf_ABMFormula

    Private Sub btn_comprobar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_comprobar.Click
        Dim documentoalteracion As New cls_documentoalteracion_
        documentoalteracion.formula = txt_formula.Text
        Try
            documentoalteracion.Resolver(1)
            DevExpress.XtraEditors.XtraMessageBox.Show("Sintaxis correcta.", "Formula", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        Catch ex As Exception
            DevExpress.XtraEditors.XtraMessageBox.Show("Error de sintaxis, compruebe la formula.", "Formula", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End Try
    End Sub


    Private Sub btn_Guardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Guardar.Click
        Dim documentoalteracion As New cls_documentoalteracion_
        documentoalteracion.formula = txt_formula.Text
        Try
            documentoalteracion.Resolver(1)
            Me.DialogResult = Windows.Forms.DialogResult.OK
        Catch ex As Exception
            DevExpress.XtraEditors.XtraMessageBox.Show("Error de sintaxis, compruebe la formula.", "Formula", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End Try
    End Sub

    Private Sub btn_Cerrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Cerrar.Click
        Me.DialogResult = Windows.Forms.DialogResult.Cancel
    End Sub


    Public Sub New(ByVal prm_formula As String)

        ' This call is required by the designer.
        InitializeComponent()
        txt_formula.Text = prm_formula
        ' Add any initialization after the InitializeComponent() call.

    End Sub
End Class